Page({
  data: {
    userInfo: {},
    isPrivacy: false,       // 是否开启隐私号码保护
    isNotDisturb: false     // 是否开启免打扰
  },

  onLoad() {
    this.getUserInfo();
  },

  getUserInfo() {
    // 模拟本地 JSON 数据
    const data = {
      avatarUrl: '/assets/default-avatar.png',
      nickName: '张三',
      mobile: '138****8888',
      mobile2: '139****9999',
      isPrivacy: 1,
      isNotDisturb: 1
    };

    this.setData({
      userInfo: data,
      isPrivacy: data.isPrivacy === 1,
      isNotDisturb: data.isNotDisturb === 1
    });
  }
});
